package com.qs.education.controller;

import java.util.HashMap;
import java.util.Map;

import org.apache.log4j.Logger;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.qs.education.bean.api.ResponseListBean;
import com.qs.education.bean.entity.EducationSubjectUnit;
import com.qs.education.service.ISubjectUnitService;

/**
 * @class SubjectUnitController
 * @author Jason
 * @description
 * @date Nov 22, 2018 4:41:00 PM
 */
@Controller
public class SubjectUnitController {

	@Autowired
	private ISubjectUnitService iSubjectUnitService;
	private final Logger log = Logger.getLogger(this.getClass());
	
	/**
	 * @Description 查询所有符合条件的单元信息(前台ajax请求)
	 * @author Jason
	 * @date Nov 22, 2018
	 * @param unit
	 */
	@RequiresPermissions(value={"user:view"})
	@RequestMapping("/getUnitAjax")
	@ResponseBody
	public ResponseListBean<EducationSubjectUnit> getUnit(EducationSubjectUnit unit){
		
		log.info("后台管理--> 查询所有符合条件的单元信息");
		ResponseListBean<EducationSubjectUnit> unitList = iSubjectUnitService.getUnitList(unit);
		
		return unitList;
	}
		
	
}
